package com.gitee.springboot.firstlesson.basic.controller;

import com.gitee.springboot.firstlesson.basic.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author guoxuehe
 * @date 2019-06-20 15:54
 * @desc com.gitee.springboot.firstlesson.basic.controller
 */
@RestController
@RequestMapping("/test")
public class Test {

    @Autowired
    private DeptService deptService;

    @RequestMapping("/trans")
    public Object transTest(){
        try {
            deptService.insertUser();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "SUCCESS";
    }

    @RequestMapping("/trans1")
    public Object transTest1(){
        deptService.insertUser1();
        return "SUCCESS";
    }

    @RequestMapping("/trans2")
    public Object transTest2(){
        deptService.insertUser2();
        return "SUCCESS";
    }

    @RequestMapping("/trans3")
    public Object transTest3(){
        deptService.insertUser3();
        return "SUCCESS";
    }
}
